Method for transmitting data in wireless system

ABSTRACT

A method for transmitting data in a wireless system, wherein the wireless system includes a first server, a relay device, and at least one appliance. The method includes that the relay device is connected to the first server through a local area network; determine whether there is a state information sent from the appliance being stored in the relay device; if so, send the state information to the first server; otherwise, send a first interactive command to the first server, wherein the first interactive command corresponds to a situation that there is no state information being stored in the relay device; send a second interactive command to the first server, and then interrupt a connection with the first server, wherein the second interactive command requests the first server to interrupt a connection with the relay device. Whereby, the first server could determine whether the relay device transmits data normally.

BACKGROUND OF THE INVENTION 1. Technical Field

The present invention relates generally to a wireless system, and moreparticularly to a method for transmitting data in a wireless system.

2. Description of Related Art

A remote control is a commonly seen component in present days to operatea home appliance wirelessly from a short distance. Typically, one remotecontrol is matched with one home appliance in a one-to-one relation,which means that each home appliance has a specific remote control tocontrol it. Therefore, with more home appliances in a home, there wouldbe more remote controls to be placed. Furthermore, home appliances ofthe same type usually have similar looking remote controls, which mayconfuse the user.

In light of this, a remote control system having a relay device isdeveloped, which allows the user to access the system with an electronicdevice such as a computer or a mobile phone through a network. Withinsuch a remote control system, the user could input a command on anelectronic device, and this command would be then transmitted to therelay device. Upon receiving the command, the relay device would convertit into a control signal, and transmit the control signal to a specifichome appliance. In this way, the user is able to control various homeappliances with one single electronic device as a remote control.

In recent years, with advantages in cloud technology, the relay devicecan be connected to a first server through an Internet, whereby to senda state information of the home appliance from the relay device to thefirst server for subsequent use. However, the first server cannotdetermine whether the relay device sends the state information or notwhen the data is lost in the Internet transmission process. In allaspects, the conventional data transmission still has room forimprovements.

BRIEF SUMMARY OF THE INVENTION

In view of the above, the primary objective of the present invention isto provide a method for transmitting data in a wireless system, whichmay ensure the reliability of the data transmission.

The present invention provides a method for transmitting data in awireless system, wherein the wireless system includes a first server, arelay device, and at least one appliance, wherein the first server andthe relay device are connected to a local area network respectively. Therelay device is wirelessly connected to the at least one appliance, andis adapted to receive and store a state information of the at least oneappliance. The method including the steps of: A. connect to the firstserver by the relay device through the local area network; B. determinewhether the relay device is stored with the state information sent fromthe at least one appliance; if so, send the state information to thefirst server by the relay device; otherwise, send a first interactivecommand to the first server by the relay device, wherein the firstinteractive command corresponds to a situation that the relay device isnot stored with any state information of the at least one appliance; C.send a second interactive command to the first server, and theninterrupt a connection between the relay device and the first server,wherein the second interactive command requests the first server tointerrupt the connection with the relay device.

Therefore, the relay device could send the first interactive command tothe first server even there is no state information being stored in thememory. In this way, the first server could determine whether the relaydevice transmits data normally or not, ensuring the reliability of datatransmission.

BRIEF DESCRIPTION OF THE FIRST SEVERAL VIEWS OF THE DRAWINGS

The present invention will be best understood by referring to thefollowing detailed description of some illustrative embodiments inconjunction with the accompanying drawings, in which

FIG. 1 is a schematic block diagram of the wireless system of a firstembodiment of the present invention;

FIG. 2 is a flowchart illustrating the operation steps of the relaydevice according to the data transmission method of the wireless systemof the first embodiment;

FIG. 3 is a flowchart illustrating the operation steps of the firstserver according to the data transmission method of the wireless systemof the first embodiment;

FIG. 4 is a flowchart of the method for transmitting data in thewireless system of a third embodiment of the present invention;

FIG. 5A and FIG. 5B are flowcharts of the method for transmitting datain the wireless system of a fifth embodiment of the present invention;

FIG. 6 is a flowchart of the method for transmitting data in thewireless system of a sixth embodiment of the present invention;

FIG. 7A and FIG. 7B are flowcharts of the method for transmitting datain the wireless system of a seventh embodiment of the present invention;

FIG. 8 is a schematic block diagram of the wireless system of an eighthembodiment of the present invention; and

FIG. 9 to FIG. 11 are flowcharts of the method for transmitting data inthe wireless system of the eighth embodiment of the present invention,showing the partial procedure of the method.

DETAILED DESCRIPTION OF THE INVENTION

A wireless system of a first embodiment of the present invention isillustrated in FIG. 1, including at least one appliance 10, a relaydevice 20, an access point 30, an electronic device 40, and a firstserver 50.

In the current embodiment, the wireless system includes a plurality ofappliances 10 which are located at a user's home, wherein the appliances10 include two controllable appliances and one detection appliance. Inthe current embodiment, the controllable appliances are an airconditioning system 10 a and a fireplace 10 b as an example, and thedetection appliance is a carbon monoxide detector 10 c as an example.Each of the appliances 10 is wirelessly connected to the relay device 20via a radio frequency signal (i.e., RF signal). However, the RF signalis not a limitation of the present invention. Other wireless signalssuch as Wi-Fi, Zigbee, Bluetooth, infrared, etc, also could be utilized.The controllable appliances are configured to receive a control commandand perform an action corresponding to the control command (e.g. poweron/off, adjusting temperature, etc.). A state information of each of thecontrollable appliances is compiled into an RF signal to be transmittedthen, wherein the state information may include a status of beingon/off, a current temperature, an error code, etc. Also, a stateinformation of the detection appliance is compiled into an RF signal tobe transmitted, wherein the state information may include a physicalquantity measured by the detection appliance (e.g. concentration ofcarbon monoxide).

The relay device 20 is at the user terminal and is wirelessly connectedto the access point 30 via a Wi-Fi signal, whereby to be connected to alocal area network at the user's home. In addition, the access point 30is also connected to an internet I. Moreover, the access point 30 canalso be connected to others appliances via wired access, which is notlimited by the Wi-Fi signal. The relay device 20 is adapted to receivean RF/Wi-Fi signal, and convert the received RF/Wi-Fi signal into acorresponding Wi-Fi/RF signal to be sent out. Also, the relay device 20is adapted to receive the RF signal including the state information fromthe appliances 10, and to interpret the received RF signal to obtain thecorresponding state information, and the corresponding state informationis stored into a memory (not shown). In addition, the relay device 20has a first counter 202 and a second counter 204, which will bedescribed in detail later.

In the current embodiment, the electronic device 40 is a tablet as anexample, which could be connected to the Internet I, wherein theelectronic device 40 could be connected to the access point 30 throughthe Internet I, or via the local area network. The electronic device 40has a built-in application, which is adapted for a user to input controlcommands (e.g. power on/off, adjusting temperature, etc.) of theappliances 10. The user could assign one of the appliances 10 to becontrolled via the application of the electronic device 40. When theelectronic device 40 is connected to the Internet I or the local areanetwork, at least one control command inputted by the user could be sentto the first server 50 through the Internet I or the local area network.Said at least one control command include an identification code of therelay device 20, at least one device code corresponding to the at leastone appliance 10, and command codes (e.g. powering on or off, adjustingtemperature, and other operations all have a corresponding commandcode), whereby to assign the relay device 20 or the to-be-controlledappliance 10.

The first server 50 is a local server, which is at the user's home andis connected to the local area network at the user's home via the accesspoint 30. The first server 50 is connected to a first database 52,wherein the first database 52 is adapted to record the control commandssent from the electronic device 40, and to store the to-be-sent controlcommand. The first server 50 and the first database 52 could execute atthe same server host or at different server hosts.

With the aforementioned configuration, a method for transmitting data inthe wireless system of the first embodiment of the present inventioncould be applied, wherein the method includes the following steps.

FIG. 2 is a flowchart of the operating procedure of the relay device 20.

In step S201, the relay device 20 is connected to the first server 50via the access point 30 through the local area network.

In step S202, the relay device 20 determines whether there is a stateinformation sent from any of the appliances 10 being stored or not.

If so, the stored state information is sent to the first server 50 bythe relay device 20.

If there is no any state information of the appliances 10 being stored,the relay device 20 sends a first interactive command to the firstserver 50, wherein the first interactive command corresponds to asituation that there is no state information of the appliances 10 beingstored in the relay device 20. In other words, the relay device 20notices the first server 50 that there is no any state information canbe uploaded to first server 50.

In step S203, after the relay device 20 sending the state information orthe first interactive command, the relay device 20 sends a secondinteractive command (i.e., a request interrupt instruction) to the firstserver 50, and then interrupts the connection with the first server 50,wherein the second interactive command requests the first server 50 tointerrupt the connection between the first server 50 and the relaydevice 20. In the current embodiment, the connection between the firstserver 50 and the relay device 20 is interrupted by the relay device 20after the second interactive command being sent for a predeterminedtime, wherein the predetermined time is more than 1 second. Thepredetermined time could avoid that a channel between the first server50 and the relay device 20 is closed before the second interactivecommand is sent to the first server 50, which may cause that the firstserver 50 cannot receive the second interactive command. In other words,the predetermined time could ensure that the second interactive commandcould be sent to the first server 50 successfully.

FIG. 3 is a flowchart of the operating procedures of the first server50.

Step S301 follows step S201, wherein in step S301, the first server 50waits for receiving data sent from the relay device 20.

In step S302, once the first server 50 receives the data sent from therelay device 20, the first server 50 analyzes the type of the receiveddata.

If the received data is the state information of the appliances 10, thefirst server 50 stores the received state information in the firstdatabase 52, and updates an appliance state of the correspondingappliance 10 in the first database 52, and sends the correspondingappliance state to the electronic device 40. Then, returning to stepS301, the first server 50 keeps waiting for receiving data sent from therelay device 20.

If the received data is the first interactive command, then returning tostep S301, the first server 50 keeps waiting for receiving data sentfrom the relay device 20.

If the received data is the second interactive command (i.e., the datais transmitted successfully), the first server 50 closes the channelbetween the relay device 20 and the first server 50, whereby tointerrupt the connection between the first server 50 and the relaydevice 20, and the first server 50 waits for a connection of other relaydevices 20 or the relay device 20 once again. In this way, theconnection resource of the first server 50 is released, so that when thewireless system includes a plurality of relay devices 20, the firstserver 50 could be connected to others relay devices 20 without beingexclusively occupied by the relay devices 20 which is originallyconnected.

If the first server 50 determines that the received data is not one ofthe state information of the appliances 10, the first interactivecommand, or the second interactive command, it represents that the dataformat of the received data is not satisfied (i.e., the data is lost inthe transmission process), and the first server 50 sends a thirdinteractive command (i.e., a request interrupt instruction) to the relaydevice 20, and interrupts the connection with the relay device 20,wherein the third interactive command requests the relay device 20 tointerrupt the connection between the first server 50 and the relaydevice 20. In the current embodiment, the connection of the channelbetween the first server 50 and the relay device 20 is interrupted bythe first server 50 after the third interactive command being sent for apredetermined time, wherein the predetermined time is more than 1second. The predetermined time could avoid that the channel between thefirst server 50 and the relay device 20 is closed by the relay device 20before the third interactive command is sent to the relay device 20,which may cause that the relay device 20 cannot receive the thirdinteractive command. In other words, the predetermined time could ensurethat the third interactive command is sent to the relay device 20successfully. Once the relay device 20 receives the third interactivecommand, returning to step S201, the relay device 20 is connected to thefirst server 50 through the local area network.

A wireless system of a second embodiment of the present invention isbased on that of the first embodiment, wherein the method has almost thesame steps as said method of the first embodiment, except that step S302in the current embodiment further includes that when the first server 50determines that the data sent from the relay device 20 is either thestate information or the first interactive command, the first server 50determines whether there is a to-be-sent control command of any of theappliances 10 being stored in the database 52 or not.

If so, the first server 50 sends the control command being stored in thedatabase 52 to the relay device 20. After the relay device 20 receivingthe control command, the relay device 20 sends the control command tothe corresponding appliance 10, and the appliance 10 performs thecorresponding action.

If the database 52 has no control command of any of the appliances 10being stored therein, the first server 50 sends a fourth interactivecommand to the relay device 20, wherein the fourth interactive commandcorresponds to a situation that there is no to-be-sent control commandof any of the appliances 10 being stored in the database 52.

In the aforementioned paragraphs, the control command and the fourthinteractive command could be sent before or after step S301.

In the aforementioned embodiments, once the relay device 20 sends outthe state information or the first interactive command in step S202,take step S203. In this way, the relay device 20 communicates with thefirst server 50 no matter there is a state information being stored inthe memory or not. Whereby, the first server 50 could determine whetherthe relay device 20 is abnormal (e.g. the connected relay device 20 doesnot send any data or the data format of the data does not satisfy),ensuring the reliability of data transmission. Certainly, step S202could be taken at least one time. Alternatively, the relay device 20sends the state information or the first interactive command many timesbefore taking step S203.

A method for transmitting data in a wireless system of a thirdembodiment is illustrated in FIG. 4, wherein the method has almost thesame steps as said method of the first embodiment.

The difference between the method of the first embodiment and that ofthe third embodiment is that, step S401 includes that a value of thefirst counter 202 of the relay device 20 is set to a first initialvalue. In the current embodiment, the first initial value is 0.

Step S402 includes that the value of the first counter 202 is adjustedto another value after a predetermined operation. In the currentembodiment, the value of the first counter 202 is added with a firstpredetermined value, wherein the first predetermined value is 1 as anexample. Certainly, the predetermined operation could be subtraction,for instance, the value of the first counter 202 minus the firstpredetermined value.

Step S403 includes that determine whether the value of the first counter202 has reached a first final value.

If so, send the second interactive command to the first server 50, andinterrupt the connection with the first server 50. In the currentembodiment, the connection between the first server 50 and the relaydevice 20 is interrupted by the relay device 20 after the secondinteractive command being sent for a predetermined time, wherein thepredetermined time is more than 1 second.

Otherwise, returning to step S402.

In the current embodiment, the first final value is 20 as an example. Inother words, the state information or the first interactive command issent 20 times when the relay device 20 is connected to the first server50, unless the data received by the first server 50 is not the stateinformation of the appliances 10, the first interactive command, or thesecond interactive command, just like step S302 of the first embodiment.At such a situation, the number of transmissions will be interruptedprematurely.

In this way, the state information or the first interactive commandcould be transmitted many times when the relay device 20 is connected tothe first server 50. Especially when the method is applied to a wirelesssystem with multiple relay devices 20, each of the relay devices 20could transmit at certain times when each of the relay devices 20 isconnected to the first server 50.

A wireless system of a fourth embodiment of the present invention isbased on that of the third embodiment. The method of the fourthembodiment includes that when the relay device 20 is connected to theaccess point 30 after a time, the relay device 20 interrupts theconnection between the access point 30 and the relay device 20, andthen, the relay device 20 is connected to the access point 30 again. Inthe current embodiment, after the relay device 20 interrupting theconnection with the access point 30, the relay device 20 restarts first,and is connected to the access point 30 then. In this way, theconnection between the relay device 20 and the access point 30 could bemore stable, whereby to avoid data loss.

A method for transmitting data in a wireless system of a fifthembodiment is illustrated in FIG. 5A and FIG. 5B, wherein the method hasalmost the same steps as said method of the third embodiment.

The difference between the method of the third embodiment and that ofthe fifth embodiment is that, the method of the fifth embodimentincludes step S500 before step S501. In step S500, the relay device 20is connected to the access point 30, and a value of the second counter204 is set to a second initial value. In the current embodiment, thesecond initial value is 0.

In step S502, the value of the first counter 202 is adjusted to anothervalue. Besides, step S502 further includes that the value of the secondcounter 204 is adjusted to another value after a predeterminedoperation. In the current embodiment, the value of the second counter204 is added with a second predetermined value, wherein the secondpredetermined value is 1 as an example. Certainly, the predeterminedoperation could be subtraction, for instance, the value of the secondcounter 204 minus the second predetermined value.

In addition, the method of the fifth embodiment further includes stepS504 (as shown in FIG. 5B) after the connection between the first server50 and the relay device 20 being interrupted in step S503. In step S504,the relay device 20 determines whether the value of the second counter204 has reached a second final value.

If so, the relay device 20 interrupts the connection with the accesspoint 30, and returning to step S500. In the current embodiment, oncethe connection between the access point 30 and the relay device 20 isinterrupted, the relay device 20 restarts first, and then returning tostep S500.

Otherwise, returning to step S501.

In the current embodiment, after the relay device 20 being connected tothe access point 30 for a period of time, the relay device 20 could alsobe connected to the access point 30 again. Whereby, the connectionbetween the relay device 20 and the access point 30 could be morestable.

A method for transmitting data in a wireless system of a sixthembodiment is illustrated in FIG. 6, wherein the method has almost thesame steps as said method of the first embodiment.

The difference between the method of the sixth embodiment and that ofthe first embodiment is that, step S601 includes that the relay device20 gets a first time information from the first server 50. Morespecifically, the relay device 20 sends a time request command to thefirst server 50. When the first server 50 receives the time requestcommand, the first server 50 sends the first time information to therelay device 20, wherein the first time information includes a currentsystem time of the first server 50.

Step S603 includes that the relay device 20 sends the time requestcommand to the first server 50, so as to get a second time informationfrom the first server 50, wherein the second time information includes acurrent system time of the first server 50. The relay device 20determines whether the time interval between the first time informationand the second time information reaches a first predetermined intervalor not.

If so, send the second interactive command to the first server 50, andthen interrupt the connection with the first server 50. In the currentembodiment, the connection between the first server 50 and the relaydevice 20 is interrupted by the relay device 20 after the secondinteractive command being sent for a predetermined time, wherein thepredetermined time is more than 1 second.

Otherwise, returning to step S602.

In the current embodiment, after the relay device 20 being connected tothe first server 50, the state information or the first interactivecommand would be transmitted many times in a period corresponding to thefirst predetermined interval. Unless the data received by the firstserver 50 in step S302 is not one of the state information of theappliances 10, the first interactive command, or the second interactivecommand. At such a situation, the number of transmissions will beinterrupted prematurely. In this way, the state information or the firstinteractive command could be transmitted many times when the relaydevice 20 is connected to the first server 50. Especially when themethod is applied to a wireless system with multiple relay devices 20,each of the relay devices 20 could transmit at certain times when eachof the relay devices 20 is connected to the first server 50.

In the current embodiment, when the relay device 20 is connected to theaccess point 30 after a time, the relay device 20 interrupts theconnection between the access point 30 and the relay device 20. Afterthe relay device 20 interrupting the connection with the access point30, the relay device 20 restarts first, and is connected to the accesspoint 30 then. In this way, the connection between the relay device 20and the access point 30 could be more stable, whereby to avoid dataloss, just like the fourth embodiment.

A method for transmitting data in a wireless system of a seventhembodiment is illustrated in FIG. 7A and FIG. 7B, wherein the method hasalmost the same steps as said method of the sixth embodiment.

The difference between the method of the seventh embodiment and that ofthe sixth embodiment is that, the method of the seventh embodimentincludes step S700 before step S701, step S700 includes that the relaydevice 20 is connected to the access point 30.

Step S703 follows step S702. The method of the seventh embodimentfurther includes step S704 (as shown in FIG. 7B) after the connectionbetween the first server 50 and the relay device 20 being interrupted instep S703. In step S704, the relay device 20 determines whether the timeinterval between the first time information and the second timeinformation reaches a second predetermined interval.

If so, the connection with the access point 30 is interrupted by therelay device 20, and returning to step S700. In the current embodiment,once the connection with the access point 30 is interrupted, the relaydevice 20 restarts first, and then returning to step S700.

Otherwise, returning to step S701.

In the current embodiment, when the relay device 20 is connected to theaccess point 30 for a period of time, the relay device 20 could also beconnected to the access point 30 again. Whereby, the connection betweenthe relay device 20 and the access point 30 could be more stable.

A wireless system of an eighth embodiment of the present invention isbased on that of the first embodiment, wherein the wireless system ofthe eighth embodiment further includes a second server 60, wherein thesecond server 60 is a remote server, which is at a remote end and isconnected to the Internet I. The second server 60 is connected to asecond database 62, wherein the second database 62 is adapted forsynchronization, and to store a to-be-downloaded data. Theto-be-downloaded data includes one of the software update data of thefirst server 50, the software update data of the relay device 20, thesoftware update data of the appliances 10, a notification message, thestate information of the appliances 10 uploaded by the first server 50.The first server 50 and the first database 52 could execute at the sameserver host or at different server hosts. The user could set thatwhether to allow the first server 50 to be connected to the secondserver 60 or not in the first server 50.

A method for transmitting data in a wireless system of the eighthembodiment has almost the same steps as said method of the firstembodiment, except that step S202 in the current embodiment in FIG. 2further includes that the first server 50 stores the at least onereceived state information into the first database 52, whereby to form ato-be-uploaded data with the at least one received state information.

After that, when the first server 50 determines that the user allows thefirst server 50 to be connected to the second server 60, the firstserver 50 periodically performs the following steps shown in FIG. 9.

Building a connection with the second server 60 by the first server 50.

The first server 50 determines whether there is the to-be-uploaded datashould be transmitted to the second server 60 or not.

If so, the first server 50 sends the to-be-uploaded data to the secondserver 60.

Otherwise, the first server 50 sends a download command to the secondserver 60.

The second server 60 performs the following steps shown in FIG. 10.

The second server 60 analyzes the received data sent from the firstserver 50.

If the received data is the to-be-uploaded data, the second server 60stores the to-be-uploaded data into the second database 62 forsubsequent analysis.

If the received data is the download command, and determining there isthe to-be-downloaded data should be sent to the first server 50, sendingthe to-be-downloaded data to the first server 50.

If the received data is neither the to-be-uploaded data nor theto-be-downloaded data, a fifth interactive command (i.e., a requestinterrupt instruction) is sent to the first server 50, and then, theconnection with the first server 50 is interrupted, wherein the fifthinteractive command requests the first server 50 to interrupt theconnection with the second server 60.

After that, the first server 50 performs the following steps shown inFIG. 11.

The first server 50 analyzes the received data sent from the secondserver 60.

If the received data is the to-be-downloaded data, the first server 50stores the to-be-downloaded data in the first database 52 forsubsequently updating the software update data of the first server 50,updating the software update data of the relay device 20, updating thesoftware update data of the appliances 10, displaying the notificationmessage on a displaying device (not shown), or retrieving the stateinformation uploaded by the first server 50.

If the received data is an error code corresponding to the downloadeddata, the download command is sent to the second server 60, wherein theerror code represents that the download data received by the firstserver 50 is incorrect (e.g. the download data is incomplete), and theerror code is generated by the first server 50.

If the received data is neither the to-be-downloaded data nor the errorcode, a sixth interactive command (i.e., a request interruptinstruction) is sent to the second server 60, and then, the connectionwith the second server 60 is interrupted, wherein the sixth interactivecommand requests the second server 60 to interrupt the connection withthe first server 50.

In this way, the state information of the appliances 10 is allowed to beuploaded to the remote end by the first server 50 at the user's home,whereby to get the to-be-downloaded data in the second server 60. Whenthe user determines to disallow the first server 50 to be connected tothe second server 60, the first server 50 would not send theto-be-uploaded data to the second server 60, whereby to ensure theuser's privacy. The method of the eighth embodiment could be alsoapplied to that of the first to seventh embodiments.

In summary, the relay device 20 of the present invention could send thefirst interactive command to the first server 50 even there is no stateinformation being stored in the memory. In this way, the first server 50could determine whether the relay device 20 transmits data normally ornot, ensuring the reliability of data transmission.

It must be pointed out that the embodiments described above are onlysome preferred embodiments of the present invention. All equivalentmethods which employ the concepts disclosed in this specification andthe appended claims should fall within the scope of the presentinvention.

What is claimed is:
 1. A method for transmitting data in a wirelesssystem, wherein the wireless system comprises a first server, a relaydevice, and at least one appliance, wherein the first server and therelay device are connected to a local area network respectively; therelay device is wirelessly connected to the at least one appliance, andis adapted to receive and store a state information of the at least oneappliance; the method comprising the steps of: A. connecting to thefirst server by the relay device through the local area network via asignal; B. determining by the relay device whether the state informationsent from the at least one appliance is stored in the relay device; ifthe relay device stores the state information sent from the at least oneappliance, then the state information is sent to the first server by therelay device; otherwise, a first interactive command is sent to thefirst server by the relay device, wherein the first interactive commandcorresponds to a situation that the relay device does not store anystate information of the at least one appliance; C. sending a secondinteractive command to the first server by the relay device, and theninterrupting a connection between the relay device and the first server,wherein the second interactive command requests the first server tointerrupt the connection with the relay device.
 2. The method of claim1, wherein step A further comprises setting a value of a first counterof the relay device to a first initial value; in step B, the value ofthe first counter is adjusted to another value by a predeterminedoperation; in step C, determining whether the value of the first counterhas reached a first final value; if the value of the first counter hasreached the first final value, then sending the second interactivecommand to the first server, and then interrupting the connection withthe first server; otherwise, repeating step B.
 3. The method of claim 2,wherein, in step C, the connection between the relay device and thefirst server is interrupted after the second interactive command beingsent for a predetermined time.
 4. The method of claim 2, wherein thewireless system further comprises an access point connected to the localarea network; the access point is adapted to be connected by the relaydevice via a Wi-Fi signal; the method further comprises the steps thatwhen the relay device is connected to the access point after a period oftime, the relay device interrupts the connection with the access point,and then, connecting to the access point again by the relay device. 5.The method of claim 2, wherein the wireless system further comprises anaccess point connected to the local area network; the access point isadapted to be connected by the relay device via a Wi-Fi signal; themethod further comprises the steps that connecting to the access pointby the relay device, and a value of a second counter is set to a secondinitial value before step A; step B further comprises that the value ofthe second counter is adjusted to another value by a predeterminedoperation; the method further comprises the steps that determiningwhether the value of the second counter has reached a second final valueafter step C; once the value of the second counter has reached a secondfinal value, the relay device interrupts the connection with the accesspoint, and then repeating the steps before step A, connecting to theaccess point again by the relay device, and setting the value of thesecond counter to the second initial value.
 6. The method of claim 5,wherein after step C, the following further steps are done: once theconnection with the access point is interrupted by the relay device, therelay device restarts first, and then repeating the steps before step A,connecting to the access point again by the relay device, and settingthe value of the second counter to the second initial value.
 7. Themethod of claim 5, wherein after step C, the following further steps aredone: repeating step B when the value of the second counter isdetermined that does not reach the second final value.
 8. The method ofclaim 1, wherein step A further comprises that the relay device gets afirst time information from the first server; step C further comprisesthat the relay device gets a second time information from the firstserver, and determining whether a time interval between the first timeinformation and the second time information reaches a firstpredetermined interval; if the time interval between the first timeinformation and the second time information reaches the firstpredetermined interval, then sending the second interactive command tothe first server, and then interrupting the connection with the firstserver; otherwise, repeating step B.
 9. The method of claim 8, wherein,in step C, the connection with the first server is interrupted after thesecond interactive command being sent for a predetermined time.
 10. Themethod of claim 8, wherein the wireless system further comprises anaccess point connected to the local area network; the access point isadapted to be connected by the relay device via a Wi-Fi signal; themethod further comprises the steps that when the relay device isconnected to the access point after a period of time, the relay deviceinterrupts a connection with the access point, and then, connecting tothe access point again by the relay device.
 11. The method of claim 8,wherein the wireless system further comprises an access point connectedto the local area network; before step A, the access point is connectedby the relay device via a Wi-Fi signal; after step C, the followingfurther steps are done: determining whether a time interval between thefirst time information and the second time information reaches a secondpredetermined interval; once the second time information reaches thesecond predetermined interval, the connection with the access point isinterrupted by the relay device, and then repeating the step before stepA of connecting to the access point again by the relay device.
 12. Themethod of claim 11, wherein after step C, the following further stepsare done: once the connection with the access point is interrupted bythe relay device, the relay device restarts first, and then repeatingthe steps before step A, connecting to the access point again by therelay device.
 13. The method of claim 1, wherein after step B, themethod further comprises the steps that when the first server determinesa data sent from the relay device is not one of the state information ofthe at least one appliance, the first interactive command, or the secondinteractive command, sending a third interactive command to the relaydevice, and then interrupting the connection with the relay device,wherein the third interactive command requests the relay device tointerrupt the connection with the first server.
 14. The method of claim13, wherein after step B, the method further comprises the steps thatwhen the relay device receives the third interactive command, repeatingstep A.
 15. The method of claim 13, wherein after step B, the methodfurther comprises the steps that the connection with the relay device isinterrupted by the first server after the third interactive command issent for a predetermined time.
 16. The method of claim 1, wherein therelay device is adapted to transmit a control command to the at leastone appliance; wherein after step B, the method further comprises thesteps that when the first server determines a data sent from the relaydevice is either the state information or the first interactive command,the first server determines whether there is a control command, which isto be sent to the at least one appliance, is stored; if the first serverdetermines that the control command to be sent to the at least oneappliance is stored, then sending the stored control command to therelay device; otherwise, sending another interactive command to therelay device, wherein the another interactive command there is nocontrol command which is to be sent to the at least one appliance beingstored.
 17. The method of claim 1, wherein the wireless system furthercomprises a second server, wherein the first server and the secondserver are connected to an internet respectively; step B furthercomprises storing the state information by the first server, whereby toform a to-be-uploaded data including the state information; the methodfurther comprises the steps that when the user determines to allow thefirst server to be connected to the second server, taking the followingsteps after step B; building a connection with the second server by thefirst server; determining whether the first server has theto-be-uploaded data which is to be sent to the second server; if thefirst server has the to-be-uploaded data which is to be sent to thesecond server, then the first server sends the to-be-uploaded data tothe second server; otherwise, the first server sends a download commandto the second server; analyzing a data sent from the first server by thesecond server; storing the to-be-uploaded data when the data sent fromthe first server is the to-be-uploaded data; sending a to-be-downloadeddata to the first server when the data sent from the first server is thedownload command, and there is the to-be-downloaded data to be sent tothe first server is determined; sending a fifth interactive command tothe first server when the data sent from the first server is neither theto-be-uploaded data nor the download command, and then, interrupting theconnection with the first server, wherein the fifth interactive commandrequests the first server to interrupt the connection with the secondserver.
 18. The method of claim 17, wherein when the first serverreceives the to-be-uploaded data, the following further steps are done:analyzing a data sent from the second server by the first server;storing the to-be-downloaded data when the data sent from the secondserver is the to-be-downloaded data; sending the download command to thesecond server when the data sent from the second server is an error codecorresponding to a downloaded data; sending a sixth interactive commandto the second server when the data sent from the second server isneither the to-be-downloaded data nor the error code, and then,interrupting the connection with the second server, wherein the sixthinteractive command requests the second server to interrupt theconnection with the first server.